package entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Objects;

/**
 * @author Lei
 * @create 2021-04-15 18:48
 */
@Entity
@Table(name = "xsb", schema = "ssh")
public class XsbEntity {
    private String xh;
    private String xm;
    private short xb;
    private Timestamp cssj;
    private int zyId;
    private Integer zxf;
    private String bz;
    private String zp;

    @Id
    @Column(name = "xh")
    public String getXh() {
        return xh;
    }

    public void setXh(String xh) {
        this.xh = xh;
    }

    @Basic
    @Column(name = "xm")
    public String getXm() {
        return xm;
    }

    public void setXm(String xm) {
        this.xm = xm;
    }

    @Basic
    @Column(name = "xb")
    public short getXb() {
        return xb;
    }

    public void setXb(short xb) {
        this.xb = xb;
    }

    @Basic
    @Column(name = "cssj")
    public Timestamp getCssj() {
        return cssj;
    }

    public void setCssj(Timestamp cssj) {
        this.cssj = cssj;
    }

    @Basic
    @Column(name = "zy_id")
    public int getZyId() {
        return zyId;
    }

    public void setZyId(int zyId) {
        this.zyId = zyId;
    }

    @Basic
    @Column(name = "zxf")
    public Integer getZxf() {
        return zxf;
    }

    public void setZxf(Integer zxf) {
        this.zxf = zxf;
    }

    @Basic
    @Column(name = "bz")
    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    @Basic
    @Column(name = "zp")
    public String getZp() {
        return zp;
    }

    public void setZp(String zp) {
        this.zp = zp;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        XsbEntity xsbEntity = (XsbEntity) o;
        return xb == xsbEntity.xb &&
                zyId == xsbEntity.zyId &&
                Objects.equals(xh, xsbEntity.xh) &&
                Objects.equals(xm, xsbEntity.xm) &&
                Objects.equals(cssj, xsbEntity.cssj) &&
                Objects.equals(zxf, xsbEntity.zxf) &&
                Objects.equals(bz, xsbEntity.bz) &&
                Objects.equals(zp, xsbEntity.zp);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(xh, xm, xb, cssj, zyId, zxf, bz);
        result = 31 * result + zp.hashCode();
        return result;
    }

}
